// 1-13 实例-13 计算自然数之和
/**
 * 计算1+2+...+n
 */
#include <iostream>
int main(void)
{

  int n, sum = 0;
  std::cout << "请输入一个正整数:";
  std::cin >> n;
  for (int i = 1; i <= n; i++)
  {
    sum += i;
  }
  std::cout << "sum:" << sum << std::endl;
  printf("---------------end-----------------\n");
  return 0;
}